//package com.itheima.Test;
//
//public class tst {
//
//    public List<Hotel> searchByFloorAndTypeAndFree(String cmbHouseFloor,String cmbHouseType, String cheFree) throws SQLException {
//        QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
//        //定义一个容器存储实际参数
//        List<String> list = new ArrayList<String>();
//        String sql = "select * from tb_hotel where 1 = 1";
//        //如果用户选择了楼层
//        int cmbHouseFloorInt = Integer.parseInt(cmbHouseFloor);
//        if(cmbHouseFloorInt > 0){
//            sql += " and houseId like ?";//模糊查询
//            list.add(cmbHouseFloor + "%");
//        }
//        //如果用户选择了房型
//        if(!cmbHouseType.equals("不限")){
//            sql += " and houseType = ?";
//            list.add(cmbHouseType);
//        }
//        //如果用户勾选了空闲复选框
//        if(cheFree != null){
//            sql += " and houseState = ?";
//            list.add("%" + 0);
//        }
//        List<Hotel> hotelList = runner.query(sql, new BeanListHandler<Hotel>(Hotel.class), list.toArray());
//        return hotelList;
//    }
//}
